package chapter17.chapter17_8;

import java.util.HashMap;

import static net.mindview.util.Print.print;

/**
 * Created by Caesar on 2016/4/3.
 */
public class Test12 {
    public static void main(String[] args) {
        HashMap<String, String> map =
                new HashMap<String, String>(6);
        map.put("sky", "blue");
        map.put("grass", "green");
        map.put("ocean", "dancing");
        map.put("tree", "tall");
        map.put("earth", "brown");
        map.put("sun", "warm");
        try {
            map.put("extra", "object"); // Past the end
        } catch (ArrayIndexOutOfBoundsException e) {
            print("Too many objects!");
        }
        print(map);
        print(map.get("ocean"));
    }
}
